<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/WEB-INF/c.tld" prefix="c" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'login.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
    <style type="text/css">
    .input{width:180px;height:25px;}
    table{position:absolute;left:700px;top:140px;}
    .put{width:60px;}
    </style>
  </head>
  
  <body background="img/4512.jpg">
    <form name="form1" action="DoLoginServlet" method="post">
      <img alt="" src="<%=basePath %>img/14.jpg" height="50" width="120">
      <font size="6" color="purple">欢迎您!</font>
      <table border="2" bordercolor="pink">
        <tr>
          <td align="center" colspan="2">
            <c:if test="${null!=msg }">
              <font color="red">${msg }</font>
            </c:if>
          </td>
        </tr>
        <tr>
          <td align="center" colspan="2">
            <font size="5" color="red">用户登录</font>
          </td>
        </tr>
        <tr>
          <td align="center">
            <font color="red">登录名</font>
          </td>
          <td align="center">
            <input type="text" class="input" name="userName" value=""/>
          </td>
        </tr>
        <tr>
          <td align="center">
            <font color="red">密码</font>
          </td>
          <td align="center">
            <input type="password" class="input" name="userPass" value=""/>
          </td>
        </tr>
         <tr>
          <td align="center">
            <input type="button" name="but" value="注册" onclick="window.location='register.jsp'"/>
          </td>
          <td align="center">
            <input type="reset" class="put" name="rs" value="重置"/>
            <input type="submit" class="put" name="sb" value="提交" onclick="return chek()"/>
          </td>
        </tr>
        <tr>
          <td align="center" colspan="2">
            <a href="superLogin.jsp">
              <font size="3" color="purple">超级用户登录获得授权码</font> 
            </a>
          </td>
        </tr>
      </table>
    </form>
  </body>
  <script type="text/javascript">
  function chek(){
	  var username=document.getElementById("userName").value;
	  var userpass=document.getElementById("userPass").value;
	  if(""==username){
		  alert("请输入登录名!");
		  return false;
	  }else{
		  if(""==userpass){
			  alert("请输入密码!");
			  return false;
		  }else{
			  return true;
		  }
	  }
  }
  </script>
</html>
